package com.yunhe.tianhe.rentcars.controller.cheliangguanli;


import com.yunhe.tianhe.commons.dto.Pageable;
import com.yunhe.tianhe.rentcars.entity.cheliangguanli.ZuYong;
import com.yunhe.tianhe.rentcars.service.cheliangguanli.ZuYongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
@RequestMapping("/zuyong")
public class ZuYongController {
    @Autowired
    private ZuYongService zuYongService;


    @RequestMapping("/list")
    public String list(){
        return "cheliangguanli/zuyong/zuyonglist";
    }

    @ResponseBody
    @RequestMapping("/listData")
    public Pageable<ZuYong> listdata(Integer offset, Integer limit, String carcode, @DateTimeFormat(pattern = "yyyy-MM-dd") Date usecartime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date returntime){
        Pageable page = zuYongService.findPage(offset, limit,carcode,usecartime,returntime);
        return page;
    }


}
